Autogenerated HTML docs for v2.15.1-433-g936d1 
diff --git a/RelNotes/2.16.0.txt b/RelNotes/2.16.0.txt index f7fca71..073a126 100644 --- a/RelNotes/2.16.0.txt +++ b/RelNotes/2.16.0.txt 
@@ -107,6 +107,19 @@  in /usr/lib and /usr/sbin; extend the list of locations to be  checked to also include directories on $PATH.   + * "git diff" learned, "--anchored", a variant of the "--patience" + algorithm, to which the user can specify which 'unique' line to be + used as anchoring points. + + * The way "git worktree add" determines what branch to create from + where and checkout in the new worktree has been updated a bit. + + * Ancient part of codebase still shows dots after an abbreviated + object name just to show that it is not a full object name, but + these ellipses are confusing to people who newly discovered Git + who are used to seeing abbreviated object names and find them + confusing with the range syntax. +    Performance, Internal Implementation, Development Support etc.   @@ -163,6 +176,13 @@  * An internal function that was left for backward compatibility has  been removed, as there is no remaining callers.   + * Historically, the diff machinery for rename detection had a + hardcoded limit of 32k paths; this is being lifted to allow users + trade cycles with a (possibly) easier to read result. + + * The tracing infrastructure has been optimized for cases where no + tracing is requested. +  Also contains various documentation updates and code clean-ups.     @@ -329,6 +349,31 @@  * A regression in the progress eye-candy was fixed.  (merge 9c5951cacf jk/progress-delay-fix later to maint).   + * The code internal to the recursive merge strategy was not fully + prepared to see a path that is renamed to try overwriting another + path that is only different in case on case insensitive systems. + This does not matter in the current code, but will start to matter + once the rename detection logic starts taking hints from nearby + paths moving to some directory and moves a new path along with them. + (merge 4cba2b0108 en/merge-recursive-icase-removal later to maint). + + * An v2.12-era regression in pathspec match logic, which made it look + into submodule tree even when it is not desired, has been fixed. + (merge eef3df5a93 bw/pathspec-match-submodule-boundary later to maint). + + * Amending commits in git-gui broke the author name that is non-ascii + due to incorrect enconding conversion. + + * Recent update to the submodule configuration code broke "diff-tree" + by accidentally stopping to read from the index upfront. + (merge fd66bcc31f bw/submodule-config-cleanup later to maint). + + * Git shows a message to tell the user that it is waiting for the + user to finish editing when spawning an editor, in case the editor + opens to a hidden window or somewhere obscure and the user gets + lost. + (merge abfb04d0c7 ls/editor-waiting-message later to maint). +  * Other minor doc, test and build updates and code cleanups.  (merge 1a1fc2d5b5 rd/man-prune-progress later to maint).  (merge 0ba014035a rd/man-reflog-add-n later to maint). @@ -338,3 +383,4 @@  (merge 5a0526264b tg/t-readme-updates later to maint).  (merge 5e83cca0b8 jk/no-optional-locks later to maint).  (merge 826c778f7c js/hashmap-update-sample later to maint). + (merge 176b2d328c sg/setup-doc-update later to maint). 
diff --git a/config.txt b/config.txt index c1598ee..b18c0f9 100644 --- a/config.txt +++ b/config.txt 
@@ -354,6 +354,9 @@ 	ignoredHook:: 	Advice shown if an hook is ignored because the hook is not 	set as executable. +	waitingForEditor:: +	Print a message to the terminal whenever Git is waiting for +	editor input from the user.  --    core.fileMode:: @@ -3468,3 +3471,13 @@ 	Specify a web browser that may be used by some commands. 	Currently only linkgit:git-instaweb[1] and linkgit:git-help[1] 	may use it. + +worktree.guessRemote:: +	With `add`, if no branch argument, and neither of `-b` nor +	`-B` nor `--detach` are given, the command defaults to +	creating a new branch from HEAD. If `worktree.guessRemote` is +	set to true, `worktree add` tries to find a remote-tracking +	branch whose name uniquely matches the new branch name. If +	such a branch exists, it is checked out and set as "upstream" +	for the new branch. If no such match can be found, it falls +	back to creating a new branch from the current HEAD. 
diff --git a/diff-options.txt b/diff-options.txt index 3c93c21..9d1586b 100644 --- a/diff-options.txt +++ b/diff-options.txt 
@@ -80,6 +80,16 @@  --histogram:: 	Generate a diff using the "histogram diff" algorithm.   +--anchored=<text>:: +	Generate a diff using the "anchored diff" algorithm. ++ +This option may be specified more than once. ++ +If a line exists in both the source and destination, exists only once, +and starts with this text, this algorithm attempts to prevent it from +appearing as a deletion or addition in the output. It uses the "patience +diff" algorithm internally. +  --diff-algorithm={patience|minimal|histogram|myers}:: 	Choose a diff algorithm. The variants are as follows:  + 
diff --git a/git-clone.html b/git-clone.html index ed9be59..0d1a031 100644 --- a/git-clone.html +++ b/git-clone.html 
@@ -753,7 +753,7 @@  [-o &lt;name&gt;] [-b &lt;name&gt;] [-u &lt;upload-pack&gt;] [--reference &lt;repository&gt;]   [--dissociate] [--separate-git-dir &lt;git dir&gt;]   [--depth &lt;depth&gt;] [--[no-]single-branch] [--no-tags]  - [--recurse-submodules] [--[no-]shallow-submodules]  + [--recurse-submodules[=&lt;pathspec&gt;]] [--[no-]shallow-submodules]   [--jobs &lt;n&gt;] [--] &lt;repository&gt; [&lt;directory&gt;]</pre>   <div class="attribution">   </div></div>  @@ -1094,15 +1094,17 @@  After the clone is created, initialize and clone submodules   within based on the provided pathspec. If no pathspec is   provided, all submodules are initialized and cloned.  - Submodules are initialized and cloned using their default  - settings. The resulting clone has <code>submodule.active</code> set to  + This option can be given multiple times for pathspecs consisting  + of multiple entries. The resulting clone has <code>submodule.active</code> set to   the provided pathspec, or "." (meaning all submodules) if no  - pathspec is provided. This is equivalent to running  - <code>git submodule update --init --recursive</code> immediately after  - the clone is finished. This option is ignored if the cloned  - repository does not have a worktree/checkout (i.e. if any of  - <code>--no-checkout</code>/<code>-n</code>, <code>--bare</code>, or <code>--mirror</code> is given)  + pathspec is provided.   </p>  +<div class="paragraph"><p>Submodules are initialized and cloned using their default settings. This is  +equivalent to running  +<code>git submodule update --init --recursive &lt;pathspec&gt;</code> immediately after  +the clone is finished. This option is ignored if the cloned repository does  +not have a worktree/checkout (i.e. if any of <code>--no-checkout</code>/<code>-n</code>, <code>--bare</code>,  +or <code>--mirror</code> is given)</p></div>   </dd>   <dt class="hdlist1">   --[no-]shallow-submodules  @@ -1353,7 +1355,7 @@  <div id="footnotes"><hr /></div>   <div id="footer">   <div id="footer-text">  -Last updated 2017-05-16 13:30:41 JST  +Last updated 2017-12-19 13:57:18 PST   </div>   </div>   </body>  
diff --git a/git-clone.txt b/git-clone.txt index 83c8e9b..42ca7b5 100644 --- a/git-clone.txt +++ b/git-clone.txt 
@@ -14,7 +14,7 @@  [-o <name>] [-b <name>] [-u <upload-pack>] [--reference <repository>]  [--dissociate] [--separate-git-dir <git dir>]  [--depth <depth>] [--[no-]single-branch] [--no-tags] - [--recurse-submodules] [--[no-]shallow-submodules] + [--recurse-submodules[=<pathspec>]] [--[no-]shallow-submodules]  [--jobs <n>] [--] <repository> [<directory>]    DESCRIPTION @@ -231,14 +231,17 @@ 	After the clone is created, initialize and clone submodules 	within based on the provided pathspec. If no pathspec is 	provided, all submodules are initialized and cloned. -	Submodules are initialized and cloned using their default -	settings. The resulting clone has `submodule.active` set to +	This option can be given multiple times for pathspecs consisting +	of multiple entries. The resulting clone has `submodule.active` set to 	the provided pathspec, or "." (meaning all submodules) if no -	pathspec is provided. This is equivalent to running -	`git submodule update --init --recursive` immediately after -	the clone is finished. This option is ignored if the cloned -	repository does not have a worktree/checkout (i.e. if any of -	`--no-checkout`/`-n`, `--bare`, or `--mirror` is given) +	pathspec is provided. ++ +Submodules are initialized and cloned using their default settings. This is +equivalent to running +`git submodule update --init --recursive <pathspec>` immediately after +the clone is finished. This option is ignored if the cloned repository does +not have a worktree/checkout (i.e. if any of `--no-checkout`/`-n`, `--bare`, +or `--mirror` is given)    --[no-]shallow-submodules:: 	All submodules which are cloned will be shallow with a depth of 1. 
diff --git a/git-config.html b/git-config.html index 99372fd..a268ebd 100644 --- a/git-config.html +++ b/git-config.html 
@@ -1876,6 +1876,15 @@  set as executable.   </p>   </dd>  +<dt class="hdlist1">  +waitingForEditor  +</dt>  +<dd>  +<p>  + Print a message to the terminal whenever Git is waiting for  + editor input from the user.  +</p>  +</dd>   </dl></div>   </div></div>   </dd>  @@ -7968,6 +7977,21 @@  may use it.   </p>   </dd>  +<dt class="hdlist1">  +worktree.guessRemote  +</dt>  +<dd>  +<p>  + With <code>add</code>, if no branch argument, and neither of <code>-b</code> nor  + <code>-B</code> nor <code>--detach</code> are given, the command defaults to  + creating a new branch from HEAD. If <code>worktree.guessRemote</code> is  + set to true, <code>worktree add</code> tries to find a remote-tracking  + branch whose name uniquely matches the new branch name. If  + such a branch exists, it is checked out and set as "upstream"  + for the new branch. If no such match can be found, it falls  + back to creating a new branch from the current HEAD.  +</p>  +</dd>   </dl></div>   </div>   </div>  
diff --git a/git-diff-files.html b/git-diff-files.html index 4ffe349..70c551e 100644 --- a/git-diff-files.html +++ b/git-diff-files.html 
@@ -865,6 +865,19 @@  </p>   </dd>   <dt class="hdlist1">  +--anchored=&lt;text&gt;  +</dt>  +<dd>  +<p>  + Generate a diff using the "anchored diff" algorithm.  +</p>  +<div class="paragraph"><p>This option may be specified more than once.</p></div>  +<div class="paragraph"><p>If a line exists in both the source and destination, exists only once,  +and starts with this text, this algorithm attempts to prevent it from  +appearing as a deletion or addition in the output. It uses the "patience  +diff" algorithm internally.</p></div>  +</dd>  +<dt class="hdlist1">   --diff-algorithm={patience|minimal|histogram|myers}   </dt>   <dd>  @@ -2429,7 +2442,7 @@  <div id="footnotes"><hr /></div>   <div id="footer">   <div id="footer-text">  -Last updated 2013-08-21 00:40:27 JST  +Last updated 2013-08-20 08:40:27 PDT   </div>   </div>   </body>  
diff --git a/git-diff-index.html b/git-diff-index.html index d9ac221..e2bba34 100644 --- a/git-diff-index.html +++ b/git-diff-index.html 
@@ -866,6 +866,19 @@  </p>   </dd>   <dt class="hdlist1">  +--anchored=&lt;text&gt;  +</dt>  +<dd>  +<p>  + Generate a diff using the "anchored diff" algorithm.  +</p>  +<div class="paragraph"><p>This option may be specified more than once.</p></div>  +<div class="paragraph"><p>If a line exists in both the source and destination, exists only once,  +and starts with this text, this algorithm attempts to prevent it from  +appearing as a deletion or addition in the output. It uses the "patience  +diff" algorithm internally.</p></div>  +</dd>  +<dt class="hdlist1">   --diff-algorithm={patience|minimal|histogram|myers}   </dt>   <dd>  @@ -2513,7 +2526,7 @@  <div id="footnotes"><hr /></div>   <div id="footer">   <div id="footer-text">  -Last updated 2017-09-10 17:38:46 JST  +Last updated 2017-09-10 01:38:46 PDT   </div>   </div>   </body>  
diff --git a/git-diff-tree.html b/git-diff-tree.html index c0cae21..25d57d9 100644 --- a/git-diff-tree.html +++ b/git-diff-tree.html 
@@ -867,6 +867,19 @@  </p>   </dd>   <dt class="hdlist1">  +--anchored=&lt;text&gt;  +</dt>  +<dd>  +<p>  + Generate a diff using the "anchored diff" algorithm.  +</p>  +<div class="paragraph"><p>This option may be specified more than once.</p></div>  +<div class="paragraph"><p>If a line exists in both the source and destination, exists only once,  +and starts with this text, this algorithm attempts to prevent it from  +appearing as a deletion or addition in the output. It uses the "patience  +diff" algorithm internally.</p></div>  +</dd>  +<dt class="hdlist1">   --diff-algorithm={patience|minimal|histogram|myers}   </dt>   <dd>  @@ -3281,7 +3294,7 @@  <div id="footnotes"><hr /></div>   <div id="footer">   <div id="footer-text">  -Last updated 2016-07-14 06:58:50 JST  +Last updated 2016-07-13 14:58:50 PDT   </div>   </div>   </body>  
diff --git a/git-diff.html b/git-diff.html index c145525..2f6cfaf 100644 --- a/git-diff.html +++ b/git-diff.html 
@@ -973,6 +973,19 @@  </p>   </dd>   <dt class="hdlist1">  +--anchored=&lt;text&gt;  +</dt>  +<dd>  +<p>  + Generate a diff using the "anchored diff" algorithm.  +</p>  +<div class="paragraph"><p>This option may be specified more than once.</p></div>  +<div class="paragraph"><p>If a line exists in both the source and destination, exists only once,  +and starts with this text, this algorithm attempts to prevent it from  +appearing as a deletion or addition in the output. It uses the "patience  +diff" algorithm internally.</p></div>  +</dd>  +<dt class="hdlist1">   --diff-algorithm={patience|minimal|histogram|myers}   </dt>   <dd>  @@ -2696,7 +2709,7 @@  <div id="footnotes"><hr /></div>   <div id="footer">   <div id="footer-text">  -Last updated 2017-04-20 14:32:42 JST  +Last updated 2017-04-19 22:32:42 PDT   </div>   </div>   </body>  
diff --git a/git-format-patch.html b/git-format-patch.html index fc71083..0f86eac 100644 --- a/git-format-patch.html +++ b/git-format-patch.html 
@@ -892,6 +892,19 @@  </p>   </dd>   <dt class="hdlist1">  +--anchored=&lt;text&gt;  +</dt>  +<dd>  +<p>  + Generate a diff using the "anchored diff" algorithm.  +</p>  +<div class="paragraph"><p>This option may be specified more than once.</p></div>  +<div class="paragraph"><p>If a line exists in both the source and destination, exists only once,  +and starts with this text, this algorithm attempts to prevent it from  +appearing as a deletion or addition in the output. It uses the "patience  +diff" algorithm internally.</p></div>  +</dd>  +<dt class="hdlist1">   --diff-algorithm={patience|minimal|histogram|myers}   </dt>   <dd>  @@ -2284,7 +2297,7 @@  <div id="footnotes"><hr /></div>   <div id="footer">   <div id="footer-text">  -Last updated 2017-08-24 06:56:20 JST  +Last updated 2017-08-23 14:56:20 PDT   </div>   </div>   </body>  
diff --git a/git-log.html b/git-log.html index bd3530d..5c43a0a 100644 --- a/git-log.html +++ b/git-log.html 
@@ -2925,6 +2925,19 @@  </p>   </dd>   <dt class="hdlist1">  +--anchored=&lt;text&gt;  +</dt>  +<dd>  +<p>  + Generate a diff using the "anchored diff" algorithm.  +</p>  +<div class="paragraph"><p>This option may be specified more than once.</p></div>  +<div class="paragraph"><p>If a line exists in both the source and destination, exists only once,  +and starts with this text, this algorithm attempts to prevent it from  +appearing as a deletion or addition in the output. It uses the "patience  +diff" algorithm internally.</p></div>  +</dd>  +<dt class="hdlist1">   --diff-algorithm={patience|minimal|histogram|myers}   </dt>   <dd>  
diff --git a/git-rev-parse.html b/git-rev-parse.html index aebb996..fee3478 100644 --- a/git-rev-parse.html +++ b/git-rev-parse.html 
@@ -1650,7 +1650,7 @@  </p>   </dd>   <dt class="hdlist1">  -The <em>&#8230;</em> (three dot) Symmetric Difference Notation  +The <em>&#8230;</em> (three-dot) Symmetric Difference Notation   </dt>   <dd>   <p>  @@ -1994,7 +1994,7 @@  <div id="footnotes"><hr /></div>   <div id="footer">   <div id="footer-text">  -Last updated 2017-10-30 14:54:51 JST  +Last updated 2017-10-29 22:54:51 PDT   </div>   </div>   </body>  
diff --git a/git-show.html b/git-show.html index 68b7a51..90f07e2 100644 --- a/git-show.html +++ b/git-show.html 
@@ -1596,6 +1596,19 @@  </p>   </dd>   <dt class="hdlist1">  +--anchored=&lt;text&gt;  +</dt>  +<dd>  +<p>  + Generate a diff using the "anchored diff" algorithm.  +</p>  +<div class="paragraph"><p>This option may be specified more than once.</p></div>  +<div class="paragraph"><p>If a line exists in both the source and destination, exists only once,  +and starts with this text, this algorithm attempts to prevent it from  +appearing as a deletion or addition in the output. It uses the "patience  +diff" algorithm internally.</p></div>  +</dd>  +<dt class="hdlist1">   --diff-algorithm={patience|minimal|histogram|myers}   </dt>   <dd>  @@ -2887,7 +2900,7 @@  <div id="footnotes"><hr /></div>   <div id="footer">   <div id="footer-text">  -Last updated 2015-05-23 05:47:07 JST  +Last updated 2015-05-22 13:47:07 PDT   </div>   </div>   </body>  
diff --git a/git-worktree.html b/git-worktree.html index 7b684ca..a28ad8b 100644 --- a/git-worktree.html +++ b/git-worktree.html 
@@ -748,7 +748,7 @@  <h2 id="_synopsis">SYNOPSIS</h2>   <div class="sectionbody">   <div class="verseblock">  -<pre class="content"><em>git worktree add</em> [-f] [--detach] [--checkout] [--lock] [-b &lt;new-branch&gt;] &lt;path&gt; [&lt;branch&gt;]  +<pre class="content"><em>git worktree add</em> [-f] [--detach] [--checkout] [--lock] [-b &lt;new-branch&gt;] &lt;path&gt; [&lt;commit-ish&gt;]   <em>git worktree list</em> [--porcelain]   <em>git worktree lock</em> [--reason &lt;string&gt;] &lt;worktree&gt;   <em>git worktree prune</em> [-n] [-v] [--expire &lt;expire&gt;]  @@ -787,19 +787,30 @@  <div class="sectionbody">   <div class="dlist"><dl>   <dt class="hdlist1">  -add &lt;path&gt; [&lt;branch&gt;]  +add &lt;path&gt; [&lt;commit-ish&gt;]   </dt>   <dd>   <p>  -Create <code>&lt;path&gt;</code> and checkout <code>&lt;branch&gt;</code> into it. The new working directory  +Create <code>&lt;path&gt;</code> and checkout <code>&lt;commit-ish&gt;</code> into it. The new working directory   is linked to the current repository, sharing everything except working   directory specific files such as HEAD, index, etc. <code>-</code> may also be  -specified as <code>&lt;branch&gt;</code>; it is synonymous with <code>@{-1}</code>.  +specified as <code>&lt;commit-ish&gt;</code>; it is synonymous with <code>@{-1}</code>.   </p>  -<div class="paragraph"><p>If <code>&lt;branch&gt;</code> is omitted and neither <code>-b</code> nor <code>-B</code> nor <code>--detach</code> used,  +<div class="paragraph"><p>If &lt;commit-ish&gt; is a branch name (call it <code>&lt;branch&gt;</code> and is not found,  +and neither <code>-b</code> nor <code>-B</code> nor <code>--detach</code> are used, but there does  +exist a tracking branch in exactly one remote (call it <code>&lt;remote&gt;</code>)  +with a matching name, treat as equivalent to</p></div>  +</dd>  +</dl></div>  +<div class="listingblock">  +<div class="content">  +<pre><code>$ git worktree add --track -b &lt;branch&gt; &lt;path&gt; &lt;remote&gt;/&lt;branch&gt;</code></pre>  +</div></div>  +<div class="paragraph"><p>+  +If <code>&lt;commit-ish&gt;</code> is omitted and neither <code>-b</code> nor <code>-B</code> nor <code>--detach</code> used,   then, as a convenience, a new branch based at HEAD is created automatically,   as if <code>-b $(basename &lt;path&gt;)</code> was specified.</p></div>  -</dd>  +<div class="dlist"><dl>   <dt class="hdlist1">   list   </dt>  @@ -854,7 +865,7 @@  </dt>   <dd>   <p>  - By default, <code>add</code> refuses to create a new working tree when <code>&lt;branch&gt;</code>  + By default, <code>add</code> refuses to create a new working tree when <code>&lt;commit-ish&gt;</code> is a branch name and   is already checked out by another working tree. This option overrides   that safeguard.   </p>  @@ -868,11 +879,11 @@  <dd>   <p>   With <code>add</code>, create a new branch named <code>&lt;new-branch&gt;</code> starting at  - <code>&lt;branch&gt;</code>, and check out <code>&lt;new-branch&gt;</code> into the new working tree.  - If <code>&lt;branch&gt;</code> is omitted, it defaults to HEAD.  + <code>&lt;commit-ish&gt;</code>, and check out <code>&lt;new-branch&gt;</code> into the new working tree.  + If <code>&lt;commit-ish&gt;</code> is omitted, it defaults to HEAD.   By default, <code>-b</code> refuses to create a new branch if it already   exists. <code>-B</code> overrides this safeguard, resetting <code>&lt;new-branch&gt;</code> to  - <code>&lt;branch&gt;</code>.  + <code>&lt;commit-ish&gt;</code>.   </p>   </dd>   <dt class="hdlist1">  @@ -889,13 +900,38 @@  </dt>   <dd>   <p>  - By default, <code>add</code> checks out <code>&lt;branch&gt;</code>, however, <code>--no-checkout</code> can  + By default, <code>add</code> checks out <code>&lt;commit-ish&gt;</code>, however, <code>--no-checkout</code> can   be used to suppress checkout in order to make customizations,   such as configuring sparse-checkout. See "Sparse checkout"   in <a href="git-read-tree.html">git-read-tree(1)</a>.   </p>   </dd>   <dt class="hdlist1">  +--[no-]guess-remote  +</dt>  +<dd>  +<p>  + With <code>worktree add &lt;path&gt;</code>, without <code>&lt;commit-ish&gt;</code>, instead  + of creating a new branch from HEAD, if there exists a tracking  + branch in exactly one remote matching the basename of `&lt;path&gt;,  + base the new branch on the remote-tracking branch, and mark  + the remote-tracking branch as "upstream" from the new branch.  +</p>  +<div class="paragraph"><p>This can also be set up as the default behaviour by using the  +<code>worktree.guessRemote</code> config option.</p></div>  +</dd>  +<dt class="hdlist1">  +--[no-]track  +</dt>  +<dd>  +<p>  + When creating a new branch, if <code>&lt;commit-ish&gt;</code> is a branch,  + mark it as "upstream" from the new branch. This is the  + default if <code>&lt;commit-ish&gt;</code> is a remote-tracking branch. See  + "--track" in <a href="git-branch.html">git-branch(1)</a> for details.  +</p>  +</dd>  +<dt class="hdlist1">   --lock   </dt>   <dd>  @@ -1108,7 +1144,7 @@  <div id="footnotes"><hr /></div>   <div id="footer">   <div id="footer-text">  -Last updated 2017-04-27 11:19:22 JST  +Last updated 2017-12-19 13:57:18 PST   </div>   </div>   </body>  
diff --git a/git-worktree.txt b/git-worktree.txt index b472acc..f850e8f 100644 --- a/git-worktree.txt +++ b/git-worktree.txt 
@@ -9,7 +9,7 @@  SYNOPSIS  --------  [verse] -'git worktree add' [-f] [--detach] [--checkout] [--lock] [-b <new-branch>] <path> [<branch>] +'git worktree add' [-f] [--detach] [--checkout] [--lock] [-b <new-branch>] <path> [<commit-ish>]  'git worktree list' [--porcelain]  'git worktree lock' [--reason <string>] <worktree>  'git worktree prune' [-n] [-v] [--expire <expire>] @@ -45,14 +45,22 @@    COMMANDS  -------- -add <path> [<branch>]:: +add <path> [<commit-ish>]::   -Create `<path>` and checkout `<branch>` into it. The new working directory +Create `<path>` and checkout `<commit-ish>` into it. The new working directory  is linked to the current repository, sharing everything except working  directory specific files such as HEAD, index, etc. `-` may also be -specified as `<branch>`; it is synonymous with `@{-1}`. +specified as `<commit-ish>`; it is synonymous with `@{-1}`.  + -If `<branch>` is omitted and neither `-b` nor `-B` nor `--detach` used, +If <commit-ish> is a branch name (call it `<branch>` and is not found, +and neither `-b` nor `-B` nor `--detach` are used, but there does +exist a tracking branch in exactly one remote (call it `<remote>`) +with a matching name, treat as equivalent to +------------ +$ git worktree add --track -b <branch> <path> <remote>/<branch> +------------ ++ +If `<commit-ish>` is omitted and neither `-b` nor `-B` nor `--detach` used,  then, as a convenience, a new branch based at HEAD is created automatically,  as if `-b $(basename <path>)` was specified.   @@ -84,29 +92,45 @@    -f::  --force:: -	By default, `add` refuses to create a new working tree when `<branch>` +	By default, `add` refuses to create a new working tree when `<commit-ish>` is a branch name and 	is already checked out by another working tree. This option overrides 	that safeguard.    -b <new-branch>::  -B <new-branch>:: 	With `add`, create a new branch named `<new-branch>` starting at -	`<branch>`, and check out `<new-branch>` into the new working tree. -	If `<branch>` is omitted, it defaults to HEAD. +	`<commit-ish>`, and check out `<new-branch>` into the new working tree. +	If `<commit-ish>` is omitted, it defaults to HEAD. 	By default, `-b` refuses to create a new branch if it already 	exists. `-B` overrides this safeguard, resetting `<new-branch>` to -	`<branch>`. +	`<commit-ish>`.    --detach:: 	With `add`, detach HEAD in the new working tree. See "DETACHED HEAD" 	in linkgit:git-checkout[1].    --[no-]checkout:: -	By default, `add` checks out `<branch>`, however, `--no-checkout` can +	By default, `add` checks out `<commit-ish>`, however, `--no-checkout` can 	be used to suppress checkout in order to make customizations, 	such as configuring sparse-checkout. See "Sparse checkout" 	in linkgit:git-read-tree[1].   +--[no-]guess-remote:: +	With `worktree add <path>`, without `<commit-ish>`, instead +	of creating a new branch from HEAD, if there exists a tracking +	branch in exactly one remote matching the basename of `<path>, +	base the new branch on the remote-tracking branch, and mark +	the remote-tracking branch as "upstream" from the new branch. ++ +This can also be set up as the default behaviour by using the +`worktree.guessRemote` config option. + +--[no-]track:: +	When creating a new branch, if `<commit-ish>` is a branch, +	mark it as "upstream" from the new branch. This is the +	default if `<commit-ish>` is a remote-tracking branch. See +	"--track" in linkgit:git-branch[1] for details. +  --lock:: 	Keep the working tree locked after creation. This is the 	equivalent of `git worktree lock` after `git worktree add`, 
diff --git a/git.html b/git.html index 036e871..2d2beca 100644 --- a/git.html +++ b/git.html 
@@ -3009,6 +3009,20 @@  <code>2&gt;&amp;1</code>, standard error will be redirected to the same handle as   standard output.</p></div>   </dd>  +<dt class="hdlist1">  +<code>GIT_PRINT_SHA1_ELLIPSIS</code> (deprecated)  +</dt>  +<dd>  +<p>  + If set to <code>yes</code>, print an ellipsis following an  + (abbreviated) SHA-1 value. This affects indications of  + detached HEADs (<a href="git-checkout.html">git-checkout(1)</a>) and the raw  + diff output (<a href="git-diff.html">git-diff(1)</a>). Printing an  + ellipsis in the cases mentioned is no longer considered  + adequate and support for it is likely to be removed in the  + foreseeable future (along with the variable).  +</p>  +</dd>   </dl></div>   </div>   </div>  @@ -3117,7 +3131,7 @@  <div id="footnotes"><hr /></div>   <div id="footer">   <div id="footer-text">  -Last updated 2017-12-06 10:03:34 PST  +Last updated 2017-12-19 13:57:18 PST   </div>   </div>   </body>  
diff --git a/git.txt b/git.txt index e75db10..3f4161a 100644 --- a/git.txt +++ b/git.txt 
@@ -736,6 +736,15 @@  `2>&1`, standard error will be redirected to the same handle as  standard output.   +`GIT_PRINT_SHA1_ELLIPSIS` (deprecated):: +	If set to `yes`, print an ellipsis following an +	(abbreviated) SHA-1 value. This affects indications of +	detached HEADs (linkgit:git-checkout[1]) and the raw +	diff output (linkgit:git-diff[1]). Printing an +	ellipsis in the cases mentioned is no longer considered +	adequate and support for it is likely to be removed in the +	foreseeable future (along with the variable). +  Discussion[[Discussion]]  ------------------------   
diff --git a/gitrevisions.html b/gitrevisions.html index 58867ac..7b0465e 100644 --- a/gitrevisions.html +++ b/gitrevisions.html 
@@ -1151,7 +1151,7 @@  </p>   </dd>   <dt class="hdlist1">  -The <em>&#8230;</em> (three dot) Symmetric Difference Notation  +The <em>&#8230;</em> (three-dot) Symmetric Difference Notation   </dt>   <dd>   <p>  @@ -1307,7 +1307,7 @@  <div id="footnotes"><hr /></div>   <div id="footer">   <div id="footer-text">  -Last updated 2016-09-13 09:53:34 JST  +Last updated 2016-09-12 17:53:34 PDT   </div>   </div>   </body>  
diff --git a/revisions.txt b/revisions.txt index 6127746..dfcc49c 100644 --- a/revisions.txt +++ b/revisions.txt 
@@ -271,7 +271,7 @@  for commits that are reachable from r2 excluding those that are reachable  from r1 by '{caret}r1 r2' and it can be written as 'r1..r2'.   -The '...' (three dot) Symmetric Difference Notation:: +The '...' (three-dot) Symmetric Difference Notation::  A similar notation 'r1\...r2' is called symmetric difference  of 'r1' and 'r2' and is defined as  'r1 r2 --not $(git merge-base --all r1 r2)'. 
diff --git a/user-manual.html b/user-manual.html index 5fa8461..2d247a5 100644 --- a/user-manual.html +++ b/user-manual.html 
@@ -1,5 +1,5 @@  <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> -<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Git User Manual</title><link rel="stylesheet" type="text/css" href="docbook-xsl.css"><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div lang="en" class="book"><div class="titlepage"><div><div><h1 class="title"><a name="idp47155537132784"></a>Git User Manual</h1></div></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl class="toc"><dt><span class="preface"><a href="#idp47155537134512"></a></span></dt><dt><span class="chapter"><a href="#repositories-and-branches">1. Repositories and Branches</a></span></dt><dd><dl><dt><span class="section"><a href="#how-to-get-a-git-repository">How to get a Git repository</a></span></dt><dt><span class="section"><a href="#how-to-check-out">How to check out a different version of a project</a></span></dt><dt><span class="section"><a href="#understanding-commits">Understanding History: Commits</a></span></dt><dd><dl><dt><span class="section"><a href="#understanding-reachability">Understanding history: commits, parents, and reachability</a></span></dt><dt><span class="section"><a href="#history-diagrams">Understanding history: History diagrams</a></span></dt><dt><span class="section"><a href="#what-is-a-branch">Understanding history: What is a branch?</a></span></dt></dl></dd><dt><span class="section"><a href="#manipulating-branches">Manipulating branches</a></span></dt><dt><span class="section"><a href="#detached-head">Examining an old version without creating a new branch</a></span></dt><dt><span class="section"><a href="#examining-remote-branches">Examining branches from a remote repository</a></span></dt><dt><span class="section"><a href="#how-git-stores-references">Naming branches, tags, and other references</a></span></dt><dt><span class="section"><a href="#Updating-a-repository-With-git-fetch">Updating a repository with git fetch</a></span></dt><dt><span class="section"><a href="#fetching-branches">Fetching branches from other repositories</a></span></dt></dl></dd><dt><span class="chapter"><a href="#exploring-git-history">2. Exploring Git history</a></span></dt><dd><dl><dt><span class="section"><a href="#using-bisect">How to use bisect to find a regression</a></span></dt><dt><span class="section"><a href="#naming-commits">Naming commits</a></span></dt><dt><span class="section"><a href="#creating-tags">Creating tags</a></span></dt><dt><span class="section"><a href="#browsing-revisions">Browsing revisions</a></span></dt><dt><span class="section"><a href="#generating-diffs">Generating diffs</a></span></dt><dt><span class="section"><a href="#viewing-old-file-versions">Viewing old file versions</a></span></dt><dt><span class="section"><a href="#history-examples">Examples</a></span></dt><dd><dl><dt><span class="section"><a href="#counting-commits-on-a-branch">Counting the number of commits on a branch</a></span></dt><dt><span class="section"><a href="#checking-for-equal-branches">Check whether two branches point at the same history</a></span></dt><dt><span class="section"><a href="#finding-tagged-descendants">Find first tagged version including a given fix</a></span></dt><dt><span class="section"><a href="#showing-commits-unique-to-a-branch">Showing commits unique to a given branch</a></span></dt><dt><span class="section"><a href="#making-a-release">Creating a changelog and tarball for a software release</a></span></dt><dt><span class="section"><a href="#Finding-commits-With-given-Content">Finding commits referencing a file with given content</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="#Developing-With-git">3. Developing with Git</a></span></dt><dd><dl><dt><span class="section"><a href="#telling-git-your-name">Telling Git your name</a></span></dt><dt><span class="section"><a href="#creating-a-new-repository">Creating a new repository</a></span></dt><dt><span class="section"><a href="#how-to-make-a-commit">How to make a commit</a></span></dt><dt><span class="section"><a href="#creating-good-commit-messages">Creating good commit messages</a></span></dt><dt><span class="section"><a href="#ignoring-files">Ignoring files</a></span></dt><dt><span class="section"><a href="#how-to-merge">How to merge</a></span></dt><dt><span class="section"><a href="#resolving-a-merge">Resolving a merge</a></span></dt><dd><dl><dt><span class="section"><a href="#conflict-resolution">Getting conflict-resolution help during a merge</a></span></dt></dl></dd><dt><span class="section"><a href="#undoing-a-merge">Undoing a merge</a></span></dt><dt><span class="section"><a href="#fast-forwards">Fast-forward merges</a></span></dt><dt><span class="section"><a href="#fixing-mistakes">Fixing mistakes</a></span></dt><dd><dl><dt><span class="section"><a href="#reverting-a-commit">Fixing a mistake with a new commit</a></span></dt><dt><span class="section"><a href="#fixing-a-mistake-by-rewriting-history">Fixing a mistake by rewriting history</a></span></dt><dt><span class="section"><a href="#checkout-of-path">Checking out an old version of a file</a></span></dt><dt><span class="section"><a href="#interrupted-work">Temporarily setting aside work in progress</a></span></dt></dl></dd><dt><span class="section"><a href="#ensuring-good-performance">Ensuring good performance</a></span></dt><dt><span class="section"><a href="#ensuring-reliability">Ensuring reliability</a></span></dt><dd><dl><dt><span class="section"><a href="#checking-for-corruption">Checking the repository for corruption</a></span></dt><dt><span class="section"><a href="#recovering-lost-changes">Recovering lost changes</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="#sharing-development">4. Sharing development with others</a></span></dt><dd><dl><dt><span class="section"><a href="#getting-updates-With-git-pull">Getting updates with git pull</a></span></dt><dt><span class="section"><a href="#submitting-patches">Submitting patches to a project</a></span></dt><dt><span class="section"><a href="#importing-patches">Importing patches to a project</a></span></dt><dt><span class="section"><a href="#public-repositories">Public Git repositories</a></span></dt><dd><dl><dt><span class="section"><a href="#setting-up-a-public-repository">Setting up a public repository</a></span></dt><dt><span class="section"><a href="#exporting-via-git">Exporting a Git repository via the Git protocol</a></span></dt><dt><span class="section"><a href="#exporting-via-http">Exporting a git repository via HTTP</a></span></dt><dt><span class="section"><a href="#pushing-changes-to-a-public-repository">Pushing changes to a public repository</a></span></dt><dt><span class="section"><a href="#forcing-push">What to do when a push fails</a></span></dt><dt><span class="section"><a href="#setting-up-a-shared-repository">Setting up a shared repository</a></span></dt><dt><span class="section"><a href="#setting-up-gitweb">Allowing web browsing of a repository</a></span></dt></dl></dd><dt><span class="section"><a href="#how-to-get-a-git-repository-with-minimal-history">How to get a Git repository with minimal history</a></span></dt><dt><span class="section"><a href="#sharing-development-examples">Examples</a></span></dt><dd><dl><dt><span class="section"><a href="#maintaining-topic-branches">Maintaining topic branches for a Linux subsystem maintainer</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="#cleaning-up-history">5. Rewriting history and maintaining patch series</a></span></dt><dd><dl><dt><span class="section"><a href="#patch-series">Creating the perfect patch series</a></span></dt><dt><span class="section"><a href="#using-git-rebase">Keeping a patch series up to date using git rebase</a></span></dt><dt><span class="section"><a href="#rewriting-one-commit">Rewriting a single commit</a></span></dt><dt><span class="section"><a href="#reordering-patch-series">Reordering or selecting from a patch series</a></span></dt><dt><span class="section"><a href="#interactive-rebase">Using interactive rebases</a></span></dt><dt><span class="section"><a href="#patch-series-tools">Other tools</a></span></dt><dt><span class="section"><a href="#problems-With-rewriting-history">Problems with rewriting history</a></span></dt><dt><span class="section"><a href="#bisect-merges">Why bisecting merge commits can be harder than bisecting linear history</a></span></dt></dl></dd><dt><span class="chapter"><a href="#advanced-branch-management">6. Advanced branch management</a></span></dt><dd><dl><dt><span class="section"><a href="#fetching-individual-branches">Fetching individual branches</a></span></dt><dt><span class="section"><a href="#fetch-fast-forwards">git fetch and fast-forwards</a></span></dt><dt><span class="section"><a href="#forcing-fetch">Forcing git fetch to do non-fast-forward updates</a></span></dt><dt><span class="section"><a href="#remote-branch-configuration">Configuring remote-tracking branches</a></span></dt></dl></dd><dt><span class="chapter"><a href="#git-concepts">7. Git concepts</a></span></dt><dd><dl><dt><span class="section"><a href="#the-object-database">The Object Database</a></span></dt><dd><dl><dt><span class="section"><a href="#commit-object">Commit Object</a></span></dt><dt><span class="section"><a href="#tree-object">Tree Object</a></span></dt><dt><span class="section"><a href="#blob-object">Blob Object</a></span></dt><dt><span class="section"><a href="#trust">Trust</a></span></dt><dt><span class="section"><a href="#tag-object">Tag Object</a></span></dt><dt><span class="section"><a href="#pack-files">How Git stores objects efficiently: pack files</a></span></dt><dt><span class="section"><a href="#dangling-objects">Dangling objects</a></span></dt><dt><span class="section"><a href="#recovering-from-repository-corruption">Recovering from repository corruption</a></span></dt></dl></dd><dt><span class="section"><a href="#the-index">The index</a></span></dt></dl></dd><dt><span class="chapter"><a href="#submodules">8. Submodules</a></span></dt><dd><dl><dt><span class="section"><a href="#_pitfalls_with_submodules">Pitfalls with submodules</a></span></dt></dl></dd><dt><span class="chapter"><a href="#low-level-operations">9. Low-level Git operations</a></span></dt><dd><dl><dt><span class="section"><a href="#object-manipulation">Object access and manipulation</a></span></dt><dt><span class="section"><a href="#the-workflow">The Workflow</a></span></dt><dd><dl><dt><span class="section"><a href="#working-directory-to-index">working directory → index</a></span></dt><dt><span class="section"><a href="#index-to-object-database">index → object database</a></span></dt><dt><span class="section"><a href="#object-database-to-index">object database → index</a></span></dt><dt><span class="section"><a href="#index-to-working-directory">index → working directory</a></span></dt><dt><span class="section"><a href="#tying-it-all-together">Tying it all together</a></span></dt></dl></dd><dt><span class="section"><a href="#examining-the-data">Examining the data</a></span></dt><dt><span class="section"><a href="#merging-multiple-trees">Merging multiple trees</a></span></dt><dt><span class="section"><a href="#merging-multiple-trees-2">Merging multiple trees, continued</a></span></dt></dl></dd><dt><span class="chapter"><a href="#hacking-git">10. Hacking Git</a></span></dt><dd><dl><dt><span class="section"><a href="#object-details">Object storage format</a></span></dt><dt><span class="section"><a href="#birdview-on-the-source-code">A birds-eye view of Git’s source code</a></span></dt></dl></dd><dt><span class="chapter"><a href="#glossary">11. Git Glossary</a></span></dt><dd><dl><dt><span class="section"><a href="#git-explained">Git explained</a></span></dt></dl></dd><dt><span class="appendix"><a href="#git-quick-start">A. Git Quick Reference</a></span></dt><dd><dl><dt><span class="section"><a href="#quick-creating-a-new-repository">Creating a new repository</a></span></dt><dt><span class="section"><a href="#managing-branches">Managing branches</a></span></dt><dt><span class="section"><a href="#exploring-history">Exploring history</a></span></dt><dt><span class="section"><a href="#making-changes">Making changes</a></span></dt><dt><span class="section"><a href="#merging">Merging</a></span></dt><dt><span class="section"><a href="#sharing-your-changes">Sharing your changes</a></span></dt><dt><span class="section"><a href="#repository-maintenance">Repository maintenance</a></span></dt></dl></dd><dt><span class="appendix"><a href="#todo">B. Notes and todo list for this manual</a></span></dt><dd><dl><dt><span class="section"><a href="#todo-list">Todo list</a></span></dt></dl></dd></dl></div><div class="preface"><div class="titlepage"><div><div><h1 class="title"><a name="idp47155537134512"></a></h1></div></div></div><p>Git is a fast distributed revision control system.</p><p>This manual is designed to be readable by someone with basic UNIX +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Git User Manual</title><link rel="stylesheet" type="text/css" href="docbook-xsl.css"><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div lang="en" class="book"><div class="titlepage"><div><div><h1 class="title"><a name="idp46175539495360"></a>Git User Manual</h1></div></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl class="toc"><dt><span class="preface"><a href="#idp46175539567872"></a></span></dt><dt><span class="chapter"><a href="#repositories-and-branches">1. Repositories and Branches</a></span></dt><dd><dl><dt><span class="section"><a href="#how-to-get-a-git-repository">How to get a Git repository</a></span></dt><dt><span class="section"><a href="#how-to-check-out">How to check out a different version of a project</a></span></dt><dt><span class="section"><a href="#understanding-commits">Understanding History: Commits</a></span></dt><dd><dl><dt><span class="section"><a href="#understanding-reachability">Understanding history: commits, parents, and reachability</a></span></dt><dt><span class="section"><a href="#history-diagrams">Understanding history: History diagrams</a></span></dt><dt><span class="section"><a href="#what-is-a-branch">Understanding history: What is a branch?</a></span></dt></dl></dd><dt><span class="section"><a href="#manipulating-branches">Manipulating branches</a></span></dt><dt><span class="section"><a href="#detached-head">Examining an old version without creating a new branch</a></span></dt><dt><span class="section"><a href="#examining-remote-branches">Examining branches from a remote repository</a></span></dt><dt><span class="section"><a href="#how-git-stores-references">Naming branches, tags, and other references</a></span></dt><dt><span class="section"><a href="#Updating-a-repository-With-git-fetch">Updating a repository with git fetch</a></span></dt><dt><span class="section"><a href="#fetching-branches">Fetching branches from other repositories</a></span></dt></dl></dd><dt><span class="chapter"><a href="#exploring-git-history">2. Exploring Git history</a></span></dt><dd><dl><dt><span class="section"><a href="#using-bisect">How to use bisect to find a regression</a></span></dt><dt><span class="section"><a href="#naming-commits">Naming commits</a></span></dt><dt><span class="section"><a href="#creating-tags">Creating tags</a></span></dt><dt><span class="section"><a href="#browsing-revisions">Browsing revisions</a></span></dt><dt><span class="section"><a href="#generating-diffs">Generating diffs</a></span></dt><dt><span class="section"><a href="#viewing-old-file-versions">Viewing old file versions</a></span></dt><dt><span class="section"><a href="#history-examples">Examples</a></span></dt><dd><dl><dt><span class="section"><a href="#counting-commits-on-a-branch">Counting the number of commits on a branch</a></span></dt><dt><span class="section"><a href="#checking-for-equal-branches">Check whether two branches point at the same history</a></span></dt><dt><span class="section"><a href="#finding-tagged-descendants">Find first tagged version including a given fix</a></span></dt><dt><span class="section"><a href="#showing-commits-unique-to-a-branch">Showing commits unique to a given branch</a></span></dt><dt><span class="section"><a href="#making-a-release">Creating a changelog and tarball for a software release</a></span></dt><dt><span class="section"><a href="#Finding-commits-With-given-Content">Finding commits referencing a file with given content</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="#Developing-With-git">3. Developing with Git</a></span></dt><dd><dl><dt><span class="section"><a href="#telling-git-your-name">Telling Git your name</a></span></dt><dt><span class="section"><a href="#creating-a-new-repository">Creating a new repository</a></span></dt><dt><span class="section"><a href="#how-to-make-a-commit">How to make a commit</a></span></dt><dt><span class="section"><a href="#creating-good-commit-messages">Creating good commit messages</a></span></dt><dt><span class="section"><a href="#ignoring-files">Ignoring files</a></span></dt><dt><span class="section"><a href="#how-to-merge">How to merge</a></span></dt><dt><span class="section"><a href="#resolving-a-merge">Resolving a merge</a></span></dt><dd><dl><dt><span class="section"><a href="#conflict-resolution">Getting conflict-resolution help during a merge</a></span></dt></dl></dd><dt><span class="section"><a href="#undoing-a-merge">Undoing a merge</a></span></dt><dt><span class="section"><a href="#fast-forwards">Fast-forward merges</a></span></dt><dt><span class="section"><a href="#fixing-mistakes">Fixing mistakes</a></span></dt><dd><dl><dt><span class="section"><a href="#reverting-a-commit">Fixing a mistake with a new commit</a></span></dt><dt><span class="section"><a href="#fixing-a-mistake-by-rewriting-history">Fixing a mistake by rewriting history</a></span></dt><dt><span class="section"><a href="#checkout-of-path">Checking out an old version of a file</a></span></dt><dt><span class="section"><a href="#interrupted-work">Temporarily setting aside work in progress</a></span></dt></dl></dd><dt><span class="section"><a href="#ensuring-good-performance">Ensuring good performance</a></span></dt><dt><span class="section"><a href="#ensuring-reliability">Ensuring reliability</a></span></dt><dd><dl><dt><span class="section"><a href="#checking-for-corruption">Checking the repository for corruption</a></span></dt><dt><span class="section"><a href="#recovering-lost-changes">Recovering lost changes</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="#sharing-development">4. Sharing development with others</a></span></dt><dd><dl><dt><span class="section"><a href="#getting-updates-With-git-pull">Getting updates with git pull</a></span></dt><dt><span class="section"><a href="#submitting-patches">Submitting patches to a project</a></span></dt><dt><span class="section"><a href="#importing-patches">Importing patches to a project</a></span></dt><dt><span class="section"><a href="#public-repositories">Public Git repositories</a></span></dt><dd><dl><dt><span class="section"><a href="#setting-up-a-public-repository">Setting up a public repository</a></span></dt><dt><span class="section"><a href="#exporting-via-git">Exporting a Git repository via the Git protocol</a></span></dt><dt><span class="section"><a href="#exporting-via-http">Exporting a git repository via HTTP</a></span></dt><dt><span class="section"><a href="#pushing-changes-to-a-public-repository">Pushing changes to a public repository</a></span></dt><dt><span class="section"><a href="#forcing-push">What to do when a push fails</a></span></dt><dt><span class="section"><a href="#setting-up-a-shared-repository">Setting up a shared repository</a></span></dt><dt><span class="section"><a href="#setting-up-gitweb">Allowing web browsing of a repository</a></span></dt></dl></dd><dt><span class="section"><a href="#how-to-get-a-git-repository-with-minimal-history">How to get a Git repository with minimal history</a></span></dt><dt><span class="section"><a href="#sharing-development-examples">Examples</a></span></dt><dd><dl><dt><span class="section"><a href="#maintaining-topic-branches">Maintaining topic branches for a Linux subsystem maintainer</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="#cleaning-up-history">5. Rewriting history and maintaining patch series</a></span></dt><dd><dl><dt><span class="section"><a href="#patch-series">Creating the perfect patch series</a></span></dt><dt><span class="section"><a href="#using-git-rebase">Keeping a patch series up to date using git rebase</a></span></dt><dt><span class="section"><a href="#rewriting-one-commit">Rewriting a single commit</a></span></dt><dt><span class="section"><a href="#reordering-patch-series">Reordering or selecting from a patch series</a></span></dt><dt><span class="section"><a href="#interactive-rebase">Using interactive rebases</a></span></dt><dt><span class="section"><a href="#patch-series-tools">Other tools</a></span></dt><dt><span class="section"><a href="#problems-With-rewriting-history">Problems with rewriting history</a></span></dt><dt><span class="section"><a href="#bisect-merges">Why bisecting merge commits can be harder than bisecting linear history</a></span></dt></dl></dd><dt><span class="chapter"><a href="#advanced-branch-management">6. Advanced branch management</a></span></dt><dd><dl><dt><span class="section"><a href="#fetching-individual-branches">Fetching individual branches</a></span></dt><dt><span class="section"><a href="#fetch-fast-forwards">git fetch and fast-forwards</a></span></dt><dt><span class="section"><a href="#forcing-fetch">Forcing git fetch to do non-fast-forward updates</a></span></dt><dt><span class="section"><a href="#remote-branch-configuration">Configuring remote-tracking branches</a></span></dt></dl></dd><dt><span class="chapter"><a href="#git-concepts">7. Git concepts</a></span></dt><dd><dl><dt><span class="section"><a href="#the-object-database">The Object Database</a></span></dt><dd><dl><dt><span class="section"><a href="#commit-object">Commit Object</a></span></dt><dt><span class="section"><a href="#tree-object">Tree Object</a></span></dt><dt><span class="section"><a href="#blob-object">Blob Object</a></span></dt><dt><span class="section"><a href="#trust">Trust</a></span></dt><dt><span class="section"><a href="#tag-object">Tag Object</a></span></dt><dt><span class="section"><a href="#pack-files">How Git stores objects efficiently: pack files</a></span></dt><dt><span class="section"><a href="#dangling-objects">Dangling objects</a></span></dt><dt><span class="section"><a href="#recovering-from-repository-corruption">Recovering from repository corruption</a></span></dt></dl></dd><dt><span class="section"><a href="#the-index">The index</a></span></dt></dl></dd><dt><span class="chapter"><a href="#submodules">8. Submodules</a></span></dt><dd><dl><dt><span class="section"><a href="#_pitfalls_with_submodules">Pitfalls with submodules</a></span></dt></dl></dd><dt><span class="chapter"><a href="#low-level-operations">9. Low-level Git operations</a></span></dt><dd><dl><dt><span class="section"><a href="#object-manipulation">Object access and manipulation</a></span></dt><dt><span class="section"><a href="#the-workflow">The Workflow</a></span></dt><dd><dl><dt><span class="section"><a href="#working-directory-to-index">working directory → index</a></span></dt><dt><span class="section"><a href="#index-to-object-database">index → object database</a></span></dt><dt><span class="section"><a href="#object-database-to-index">object database → index</a></span></dt><dt><span class="section"><a href="#index-to-working-directory">index → working directory</a></span></dt><dt><span class="section"><a href="#tying-it-all-together">Tying it all together</a></span></dt></dl></dd><dt><span class="section"><a href="#examining-the-data">Examining the data</a></span></dt><dt><span class="section"><a href="#merging-multiple-trees">Merging multiple trees</a></span></dt><dt><span class="section"><a href="#merging-multiple-trees-2">Merging multiple trees, continued</a></span></dt></dl></dd><dt><span class="chapter"><a href="#hacking-git">10. Hacking Git</a></span></dt><dd><dl><dt><span class="section"><a href="#object-details">Object storage format</a></span></dt><dt><span class="section"><a href="#birdview-on-the-source-code">A birds-eye view of Git’s source code</a></span></dt></dl></dd><dt><span class="chapter"><a href="#glossary">11. Git Glossary</a></span></dt><dd><dl><dt><span class="section"><a href="#git-explained">Git explained</a></span></dt></dl></dd><dt><span class="appendix"><a href="#git-quick-start">A. Git Quick Reference</a></span></dt><dd><dl><dt><span class="section"><a href="#quick-creating-a-new-repository">Creating a new repository</a></span></dt><dt><span class="section"><a href="#managing-branches">Managing branches</a></span></dt><dt><span class="section"><a href="#exploring-history">Exploring history</a></span></dt><dt><span class="section"><a href="#making-changes">Making changes</a></span></dt><dt><span class="section"><a href="#merging">Merging</a></span></dt><dt><span class="section"><a href="#sharing-your-changes">Sharing your changes</a></span></dt><dt><span class="section"><a href="#repository-maintenance">Repository maintenance</a></span></dt></dl></dd><dt><span class="appendix"><a href="#todo">B. Notes and todo list for this manual</a></span></dt><dd><dl><dt><span class="section"><a href="#todo-list">Todo list</a></span></dt></dl></dd></dl></div><div class="preface"><div class="titlepage"><div><div><h1 class="title"><a name="idp46175539567872"></a></h1></div></div></div><p>Git is a fast distributed revision control system.</p><p>This manual is designed to be readable by someone with basic UNIX  command-line skills, but no previous knowledge of Git.</p><p><a class="xref" href="#repositories-and-branches" title="Chapter 1. Repositories and Branches">Chapter 1, <i>Repositories and Branches</i></a> and <a class="xref" href="#exploring-git-history" title="Chapter 2. Exploring Git history">Chapter 2, <i>Exploring Git history</i></a> explain how  to fetch and study a project using git—read these chapters to learn how  to build and test a particular version of a software project, search for @@ -169,7 +169,7 @@    git checkout -b new_branch_name   -HEAD is now at 427abfa... Linux v2.6.17</pre><p>The HEAD then refers to the SHA-1 of the commit instead of to a branch, +HEAD is now at 427abfa Linux v2.6.17</pre><p>The HEAD then refers to the SHA-1 of the commit instead of to a branch,  and git branch shows that you are no longer on a branch:</p><pre class="literallayout">$ cat .git/HEAD  427abfa28afedffadfca9dd8b067eb6d36bac53f  $ git branch @@ -257,7 +257,7 @@  Bisecting: 3537 revisions left to test after this  [65934a9a028b88e83e2b0f8b36618fe503349f8e] BLOCK: Make USB storage depend on SCSI rather than selecting it [try #6]</pre><p>If you run <code class="literal">git branch</code> at this point, you’ll see that Git has  temporarily moved you in "(no branch)". HEAD is now detached from any -branch and points directly to a commit (with commit id 65934…) that +branch and points directly to a commit (with commit id 65934) that  is reachable from "master" but not from v2.6.18. Compile and test it,  and see whether it crashes. Assume it does crash. Then:</p><pre class="literallayout">$ git bisect bad  Bisecting: 1769 revisions left to test after this @@ -273,9 +273,9 @@  occasionally you may land on a commit that broke something unrelated;  run</p><pre class="literallayout">$ git bisect visualize</pre><p>which will run gitk and label the commit it chose with a marker that  says "bisect". Choose a safe-looking commit nearby, note its commit -id, and check it out with:</p><pre class="literallayout">$ git reset --hard fb47ddb2db...</pre><p>then test, run <code class="literal">bisect good</code> or <code class="literal">bisect bad</code> as appropriate, and +id, and check it out with:</p><pre class="literallayout">$ git reset --hard fb47ddb2db</pre><p>then test, run <code class="literal">bisect good</code> or <code class="literal">bisect bad</code> as appropriate, and  continue.</p><p>Instead of <code class="literal">git bisect visualize</code> and then <code class="literal">git reset --hard -fb47ddb2db...</code>, you might just want to tell Git that you want to skip +fb47ddb2db</code>, you might just want to tell Git that you want to skip  the current commit:</p><pre class="literallayout">$ git bisect skip</pre><p>In this case, though, Git may not eventually be able to tell the first  bad one between some first skipped commits and a later bad commit.</p><p>There are also ways to automate the bisecting process if you have a  test script that can tell a good from a bad commit. See @@ -1481,7 +1481,7 @@  Author:  Date:  ... -:100644 100644 4b9458b... newsha... M somedirectory/myfile +:100644 100644 4b9458b newsha M somedirectory/myfile      commit xyz @@ -1489,11 +1489,11 @@  Date:    ... -:100644 100644 oldsha... 4b9458b... M somedirectory/myfile</pre><p>This tells you that the immediately following version of the file was +:100644 100644 oldsha 4b9458b M somedirectory/myfile</pre><p>This tells you that the immediately following version of the file was  "newsha", and that the immediately preceding version was "oldsha".  You also know the commit messages that went with the change from oldsha  to 4b9458b and with the change from 4b9458b to newsha.</p><p>If you’ve been committing small enough changes, you may now have a good -shot at reconstructing the contents of the in-between state 4b9458b.</p><p>If you can do that, you can now recreate the missing object with</p><pre class="literallayout">$ git hash-object -w &lt;recreated-file&gt;</pre><p>and your repository is good again!</p><p>(Btw, you could have ignored the <code class="literal">fsck</code>, and started with doing a</p><pre class="literallayout">$ git log --raw --all</pre><p>and just looked for the sha of the missing object (4b9458b..) in that +shot at reconstructing the contents of the in-between state 4b9458b.</p><p>If you can do that, you can now recreate the missing object with</p><pre class="literallayout">$ git hash-object -w &lt;recreated-file&gt;</pre><p>and your repository is good again!</p><p>(Btw, you could have ignored the <code class="literal">fsck</code>, and started with doing a</p><pre class="literallayout">$ git log --raw --all</pre><p>and just looked for the sha of the missing object (4b9458b) in that  whole thing. It’s up to you—Git does <span class="strong"><strong>have</strong></span> a lot of information, it is  just missing one particular blob version.</p></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="the-index"></a>The index</h2></div></div></div><p>The index is a binary file (generally kept in <code class="literal">.git/index</code>) containing a  sorted list of path names, each with permissions and the SHA-1 of a blob @@ -1819,9 +1819,9 @@  <code class="literal">$orig</code> to <code class="literal">HEAD</code> and <code class="literal">$orig</code> to <code class="literal">$target</code> in a different way.  You could resolve this by running your favorite 3-way merge  program, e.g. <code class="literal">diff3</code>, <code class="literal">merge</code>, or Git’s own merge-file, on -the blob objects from these three stages yourself, like this:</p><pre class="literallayout">$ git cat-file blob 263414f... &gt;hello.c~1 -$ git cat-file blob 06fa6a2... &gt;hello.c~2 -$ git cat-file blob cc44c73... &gt;hello.c~3 +the blob objects from these three stages yourself, like this:</p><pre class="literallayout">$ git cat-file blob 263414f &gt;hello.c~1 +$ git cat-file blob 06fa6a2 &gt;hello.c~2 +$ git cat-file blob cc44c73 &gt;hello.c~3  $ git merge-file hello.c~2 hello.c~1 hello.c~3</pre><p>This would leave the merge result in <code class="literal">hello.c~2</code> file, along  with conflict markers if there are conflicts. After verifying  the merge result makes sense, you can tell Git what the final @@ -1946,7 +1946,7 @@  corresponding commit.</p><p>Example: If you know that there was some test case for <code class="literal">git bundle</code>, but  do not remember where it was (yes, you <span class="emphasis"><em>could</em></span> <code class="literal">git grep bundle t/</code>, but that  does not illustrate the point!):</p><pre class="literallayout">$ git log --no-merges t/</pre><p>In the pager (<code class="literal">less</code>), just search for "bundle", go a few lines back, -and see that it is in commit 18449ab0… Now just copy this object name, +and see that it is in commit 18449ab0. Now just copy this object name,  and paste it into the command line</p><pre class="literallayout">$ git show 18449ab0</pre><p>Voila.</p><p>Another example: Find out what to do in order to make some script a  builtin:</p><pre class="literallayout">$ git log --no-merges --diff-filter=A builtin/*.c</pre><p>You see, Git is actually the best tool to find out about the source of Git  itself!</p></div></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a name="glossary"></a>Chapter 11. Git Glossary</h1></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl class="toc"><dt><span class="section"><a href="#git-explained">Git explained</a></span></dt></dl></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="git-explained"></a>Git explained</h2></div></div></div><div class="variablelist"><dl class="variablelist"><dt><span class="term"> 
diff --git a/user-manual.txt b/user-manual.txt index 3a03e63..eff7890 100644 --- a/user-manual.txt +++ b/user-manual.txt 
@@ -319,7 +319,7 @@    git checkout -b new_branch_name   -HEAD is now at 427abfa... Linux v2.6.17 +HEAD is now at 427abfa Linux v2.6.17  ------------------------------------------------    The HEAD then refers to the SHA-1 of the commit instead of to a branch, @@ -508,7 +508,7 @@    If you run `git branch` at this point, you'll see that Git has  temporarily moved you in "(no branch)". HEAD is now detached from any -branch and points directly to a commit (with commit id 65934...) that +branch and points directly to a commit (with commit id 65934) that  is reachable from "master" but not from v2.6.18. Compile and test it,  and see whether it crashes. Assume it does crash. Then:   @@ -549,14 +549,14 @@  id, and check it out with:    ------------------------------------------------- -$ git reset --hard fb47ddb2db... +$ git reset --hard fb47ddb2db  -------------------------------------------------    then test, run `bisect good` or `bisect bad` as appropriate, and  continue.    Instead of `git bisect visualize` and then `git reset --hard -fb47ddb2db...`, you might just want to tell Git that you want to skip +fb47ddb2db`, you might just want to tell Git that you want to skip  the current commit:    ------------------------------------------------- @@ -3416,7 +3416,7 @@  Author:  Date:  ... -:100644 100644 4b9458b... newsha... M somedirectory/myfile +:100644 100644 4b9458b newsha M somedirectory/myfile      commit xyz @@ -3424,7 +3424,7 @@  Date:    ... -:100644 100644 oldsha... 4b9458b... M somedirectory/myfile +:100644 100644 oldsha 4b9458b M somedirectory/myfile  ------------------------------------------------    This tells you that the immediately following version of the file was @@ -3449,7 +3449,7 @@  $ git log --raw --all  ------------------------------------------------   -and just looked for the sha of the missing object (4b9458b..) in that +and just looked for the sha of the missing object (4b9458b) in that  whole thing. It's up to you--Git does *have* a lot of information, it is  just missing one particular blob version.   @@ -4114,9 +4114,9 @@  the blob objects from these three stages yourself, like this:    ------------------------------------------------ -$ git cat-file blob 263414f... >hello.c~1 -$ git cat-file blob 06fa6a2... >hello.c~2 -$ git cat-file blob cc44c73... >hello.c~3 +$ git cat-file blob 263414f >hello.c~1 +$ git cat-file blob 06fa6a2 >hello.c~2 +$ git cat-file blob cc44c73 >hello.c~3  $ git merge-file hello.c~2 hello.c~1 hello.c~3  ------------------------------------------------   @@ -4374,7 +4374,7 @@  ------------------------    In the pager (`less`), just search for "bundle", go a few lines back, -and see that it is in commit 18449ab0... Now just copy this object name, +and see that it is in commit 18449ab0. Now just copy this object name,  and paste it into the command line    -------------------